# -*- coding: utf-8 -*-
#
# Copyright (C) 2006 Ville Leskinen
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA

"""This module provides basic exception classes for igCreator"""

class igCreatorError(Exception):
	"""Parent error type"""
	def __init__(self, message, errorCode=-1):
		"""Constructor

		@param message: Error message
		@type message: string
		@param errorCode: error code
		@type errorCode: integer"""
		Exception.__init__(self, message)
		self.errorCode = errorCode

class ImageListError(igCreatorError):
	"""Error that happened in L{igCreator.imagelist.ImageList}"""
	def __init__(self, message):
		"""Constructor

		@param message: Error message"""
		igCreatorError.__init__(self, message, 1)

class GalleryError(igCreatorError):
	"""Error that happened in L{igCreator.gallery.Gallery}"""
	def __init__(self, message):
		"""Constructor

		@param message: Errro message"""
		igCreatorError.__init__(self, message, 2)

class OptionError(igCreatorError):
	def __init__(self, message):
		igCreatorError.__init__(self, message, 3)
